<{include file="app/header.tpl"}>

<div class="order-evaluation" id="order-evaluation">

    <{foreach from=$goodsList item="goods"}>
    <div class="goods-evaluation">
	    <div class="line">
	        <p class="left"><img src="<{$goods.thumbsrc}>" class="img" alt=""></p>
	        <p class="middle">描述相符</p>
	        <p class="right fix">
	            <span <{if $goods.pinglun.miaoshu >= 1}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.miaoshu >= 2}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.miaoshu >= 3}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.miaoshu >= 4}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.miaoshu >= 5}>class="show"<{/if}>></span>
	        </p>
	    </div>
	
        <div class="text"><{$goods.pinglun.comments}></div>
	
	    <div class="line">
	        <p class="left"></p>
	        <p class="middle">服务态度</p>
	        <p class="right fix">
	            <span <{if $goods.pinglun.fuwu >= 1}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.fuwu >= 2}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.fuwu >= 3}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.fuwu >= 4}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.fuwu >= 5}>class="show"<{/if}>></span>
	        </p>
	    </div>
	    <div class="line">
	        <p class="left"></p>
	        <p class="middle">发货速度</p>
	        <p class="right fix">
	            <span <{if $goods.pinglun.fahuo >= 1}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.fahuo >= 2}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.fahuo >= 3}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.fahuo >= 4}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.fahuo >= 5}>class="show"<{/if}>></span>
	        </p>
	    </div>
	    <div class="line">
	        <p class="left"></p>
	        <p class="middle">物流速度</p>
	        <p class="right fix">
	            <span <{if $goods.pinglun.wuliu >= 1}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.wuliu >= 2}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.wuliu >= 3}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.wuliu >= 4}>class="show"<{/if}>></span>
	            <span <{if $goods.pinglun.wuliu >= 5}>class="show"<{/if}>></span>
	        </p>
	    </div>
    </div>
    <{/foreach}>
</div>

<script>

    //star_grade('.order-evaluation', 'gradeInput');

    $(document).ready(function () {
        $('.goods-evaluation').each (function () {
            star_grade(this);
        });
    });


    function star_grade(boxItem) { // 评价星星

        var starItem = $(boxItem).find('.right');
        var input    = $(boxItem).find('input');

        for (var i = 0; i < starItem.length; i++) {
            (function(i) {
                var star = starItem[i].getElementsByTagName("span");
                for (var j = 0; j < star.length; j++) {
                    (function(j) {
                        star[j].onclick = function() {
                             show(star, j);
                             lock(i, j);
                        };
                    })(j);
                }
            })(i);
        }

        function show(o, k) {
            for (var i = 0; i < o.length; i++) {
                o[i].className = "";
                if (i <= k) o[i].className = "show";
            }
        }

        function lock(x, k) {
            input[x].value = k + 1;
        }
    }

    document.body.style.backgroundColor = '#fff';
</script>

<{include file="app/footer.tpl"}>
